* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    }

    body {
      background: linear-gradient(145deg, #dcebf5 0%, #c4d8ea 100%);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
    }

    .main-card {
      max-width: 1100px;
      width: 100%;
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-radius: 2.5rem;
      box-shadow: 0 25px 45px -12px rgba(4, 30, 55, 0.4), inset 0 1px 2px white;
      padding: 2rem 2.2rem;
      border: 1px solid rgba(255,255,255,0.7);
    }

    h1 {
      font-size: 2.5rem;
      font-weight: 700;
      background: linear-gradient(130deg, #082338, #1b4f75);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 0.8rem;
      margin-bottom: 0.2rem;
    }

    .badge {
      background: #0f3b5c;
      color: white;
      font-size: 0.8rem;
      font-weight: 500;
      padding: 0.3rem 1.2rem;
      border-radius: 40px;
      letter-spacing: 0.3px;
      -webkit-text-fill-color: white;
      background: linear-gradient(145deg, #1a4f74, #0e3a58);
      box-shadow: inset 0 1px 3px rgba(255,255,255,0.4);
    }

    .sub {
      color: #1d4b6b;
      margin-bottom: 1.8rem;
      font-size: 1.05rem;
      border-left: 5px solid #2679a5;
      padding-left: 1.2rem;
      display: flex;
      gap: 1rem;
      align-items: center;
    }
    .realtime-badge {
      background: #115c8f;
      color: white;
      border-radius: 30px;
      padding: 0.2rem 1.2rem;
      font-size: 0.8rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: 1.1fr 2fr;
      gap: 1.5rem;
      margin: 1.8rem 0 1.2rem;
    }

    .input-panel {
      background: #ffffffd6;
      border-radius: 2rem;
      padding: 1.4rem 1.2rem;
      box-shadow: 0 10px 20px rgba(0,32,64,0.12);
      border: 1px solid rgba(255,255,255,0.9);
    }

    .input-group {
      margin-bottom: 1.3rem;
    }

    label {
      font-weight: 600;
      color: #0c3f5e;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      margin-bottom: 0.4rem;
      font-size: 0.95rem;
    }

    input, textarea, select {
      width: 100%;
      padding: 0.8rem 1.2rem;
      border: 1.5px solid #c8ddec;
      border-radius: 1.8rem;
      font-size: 0.95rem;
      background: white;
      transition: 0.15s;
    }

    input:focus, textarea:focus {
      outline: none;
      border-color: #1f7aa5;
      box-shadow: 0 0 0 3px rgba(31,122,165,0.2);
    }

    textarea {
      border-radius: 1.5rem;
      resize: vertical;
    }

    .file-zone {
      background: #e9f2fa;
      border-radius: 1.8rem;
      padding: 0.6rem 1.2rem;
      border: 2px dashed #98bedc;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .file-label {
      background: #103a5a;
      color: white;
      padding: 0.3rem 1.2rem;
      border-radius: 2.5rem;
      font-size: 0.8rem;
      font-weight: 500;
      cursor: pointer;
      transition: 0.1s;
    }

    .file-label:hover {
      background: #1d5279;
    }

    #fileInfo {
      font-size: 0.8rem;
      color: #14415e;
      max-width: 160px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .action-row {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      margin: 2rem 0 1rem;
    }

    button {
      background: white;
      border: none;
      padding: 0.9rem 2rem;
      border-radius: 3rem;
      font-weight: 600;
      font-size: 1.1rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      box-shadow: 0 8px 18px rgba(19, 62, 102, 0.2);
      cursor: pointer;
      transition: 0.15s;
      border: 1px solid rgba(255,255,255,0.8);
      flex: 1 0 auto;
    }

    #generateBtn {
      background: #0f3a5a;
      color: white;
      border: 1px solid #346a92;
    }

    #generateBtn:hover:not(:disabled) {
      background: #1a4f74;
      transform: scale(1.02);
    }

    #downloadBtn {
      background: #e8f0f9;
      color: #0f3a5a;
    }

    #downloadBtn:hover:not(:disabled) {
      background: #d4e3f2;
    }

    button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      box-shadow: none;
      transform: none;
    }

    .cover-preview {
      background: #fbfeff;
      border-radius: 2rem;
      padding: 1.8rem 1.8rem;
      box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 8px 18px rgba(0,55,90,0.12);
      border: 1px solid rgba(255,255,255,0.9);
    }

    .cover-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.2rem;
    }

    .cover-header h3 {
      color: #103652;
      font-size: 1.3rem;
    }

    #characterCount {
      background: #cedce9;
      padding: 0.2rem 1rem;
      border-radius: 30px;
      font-size: 0.8rem;
      color: #052134;
    }

    #coverLetterOutput {
      background: white;
      border-radius: 1.5rem;
      padding: 1.5rem;
      min-height: 260px;
      max-height: 420px;
      overflow-y: auto;
      font-size: 0.95rem;
      line-height: 1.6;
      white-space: pre-wrap;
      border: 1px solid #dbe8f2;
      color: #1d3b54;
      box-shadow: inset 0 1px 5px #cbdae7;
    }

    .placeholder-note {
      color: #728faa;
      font-style: italic;
    }

    .progress {
      margin-top: 0.8rem;
      background: rgba(0,0,0,0.05);
      border-radius: 50px;
      height: 8px;
      width: 100%;
      overflow: hidden;
    }

    #progressFill {
      height: 8px;
      width: 0%;
      background: linear-gradient(90deg, #1e6a9f, #389ed6);
      border-radius: 50px;
      transition: width 0.2s;
    }

    #statusMessage {
      font-size: 0.95rem;
      color: #1d5273;
      margin-top: 0.8rem;
      background: rgba(255,255,255,0.7);
      border-radius: 3rem;
      padding: 0.5rem 1.2rem;
      border: 1px solid white;
    }

    .secure-badge {
      background: #d2e6f5;
      border-radius: 30px;
      padding: 0.1rem 1rem;
      font-size: 0.7rem;
      display: inline-block;
    }

    footer {
      margin-top: 2rem;
      text-align: center;
      color: #245373;
      font-size: 0.8rem;
    }

    hr {
      border: 0.5px solid #c1d8ec;
      margin: 1rem 0;
    }

    .internet-row {
      display: flex;
      gap: 10px;
      background: #e4eff8;
      border-radius: 3rem;
      padding: 0.5rem 1rem;
      align-items: center;
      margin-bottom: 1rem;
      font-size: 0.9rem;
      border: 1px solid white;
    }
    .live-link {
      color: #0d4263;
      font-weight: 600;
      text-decoration: none;
      border-bottom: 1px dashed;
    }
    .live-link:hover {
      color: #06283e;
    }

    @media (max-width: 768px) {
      body {
        padding: 0.8rem;
        align-items: flex-start;
      }
      .main-card {
        border-radius: 1.8rem;
        padding: 1.2rem 1rem;
      }
      h1 {
        font-size: 1.8rem;
        flex-wrap: wrap;
      }
      .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
      }
      .cover-preview {
        padding: 1rem;
        border-radius: 1.5rem;
      }
      .cover-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
      }
      #coverLetterOutput {
        min-height: 200px;
        max-height: 350px;
        padding: 1rem;
      }
      .action-row {
        flex-direction: column;
      }
      button {
        width: 100%;
        justify-content: center;
      }
      .internet-row {
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
      }
    }

    @media (max-width: 480px) {
      .main-card {
        padding: 0.8rem 0.6rem;
        border-radius: 1.2rem;
      }
      h1 {
        font-size: 1.4rem;
      }
      input, textarea, select {
        font-size: 16px;
        padding: 0.6rem 1rem;
      }
      button {
        min-height: 44px;
        font-size: 0.95rem;
      }
      .file-zone {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.8rem;
      }
      .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.8rem;
      }
      .sub {
        font-size: 0.9rem;
        padding-left: 0.8rem;
      }
      #coverLetterOutput {
        font-size: 0.9rem;
      }
      .input-panel {
        padding: 1rem;
      }
    }